home *** CD-ROM | disk | FTP | other *** search
/ Ultimedia 1 / Ultimedia 1.iso / tools / soundtools / playsid / jukebox.rexx < prev    next >
OS/2 REXX Batch file  |  1993-04-16  |  830b  |  44 lines

  1. /*
  2.  * PlaySID: Jukebox example
  3.  *
  4.  * rx jukebox "filename"
  5.  *
  6.  *         or
  7.  *
  8.  * jukebox.rexx "filename"
  9.  *
  10.  */
  11.  
  12. if(~show('l', 'rexxsupport.library'))then do
  13.    if(~addlib( 'rexxsupport.library', 0, -30, 0))then do
  14.       say "Could not open ARexx support library."
  15.       exit 10
  16.    end
  17. end
  18.  
  19. file = 'file'
  20. parse arg data
  21.  
  22. if open(file, data, 'r') then do
  23.    address command "run SID:PlaySID"
  24.    line = readln(file)
  25.    do while ~eof(file)
  26.       name = word(line, 1)
  27.       tune = word(line, 2)
  28.       time = word(line, 3)
  29.       if SID_Load(name) then do
  30.          say "Playing tune" tune "for" time "seconds in" name
  31.          SID_SetTune(tune)
  32.          SID_Play()
  33.          Delay(time * 50)
  34.          SID_Stop()
  35.       end
  36.       line = readln(file)
  37.    end
  38.    SID_Quit()
  39.    call close(file)
  40. end
  41. else
  42.    say "Unable to open file" data"."
  43.  
  44.